<?php
/*
--- List Function 
	-  SearchFilter() Allow search page with empty variable of paramater s
	

*/
//add post format to theme
add_theme_support( 'post-formats', array('gallery'));

function SearchFilter($query) {
    // If 's' request variable is set but empty
    if (isset($_GET['s']) && empty($_GET['s']) && $query->is_main_query()){
        $query->is_search = true;
        $query->is_home = false;
    }
    return $query;
}
add_filter('pre_get_posts','SearchFilter');

function zonthemes_price_formats($number, $cents = 1) { // cents: 0=never, 1=if needed, 2=always
  
  $dec_sep = get_option('zon_option_symbol_decimals');
  if(empty($dec_sep)) $dec_sep = '.';
  
  
  $tho_sep = get_option('zon_option_symbol_thousand');
  if(empty($tho_sep)) $tho_sep = ',';
  
  
  //dec,thou
  
  if (is_numeric($number)) { // a number
    if (!$number) { // zero
      $money = ($cents == 2 ? '0'.$dec_sep.'00' : '0'); // output zero
    } else { // value
      if (floor($number) == $number) { // whole number
        $money = number_format($number, ($cents == 2 ? 2 : 0), $dec_sep, $tho_sep ); // format
      } else { // cents
        $money = number_format(round($number, 2), ($cents == 0 ? 0 : 2), $dec_sep, $tho_sep ); // format
      } // integer or decimal
    } // value
    return $money;
  } // numeric
} // formatMoney

function zonthemes_get_show_price($price, $cents = 2){
	$AuctionTheme_currency_position = get_option('zon_option_symbol_positions'); 
	if($AuctionTheme_currency_position == "front") return AuctionTheme_get_currency()."".AuctionTheme_formats($price, $cents); 
 	return AuctionTheme_formats($price,$cents)."".AuctionTheme_get_currency();  
}
?>